# import math
# # 常规代码
# def circlearea(r):
#     result = math.pi*r*r
#     return result
# r = 10
# print('半径为',r,'的圆面积为：',circlearea(r))
#
# # 使用lambda表达式
# m = 10
# rs = lambda m:math.pi*m*m
# print('半径为',m,'的圆面积为：',rs(m))

#
# def get_key(bookinfo){
#     return bookinfo[2]
# }
bookinfo =[('不一样的卡梅拉（全套)',22.50,120),('零基础学Android',65.10,89.80),('摆渡人',23.40,36.00),('福尔摩斯探案全集8册',22.50,128)]

print('爬取的商品信息：\n',bookinfo,'\n')

bookinfo.sort(key=lambda x:x[1]/x[2])
for x in bookinfo:
    print(x)
print('排序后的商品信息：\n',bookinfo)

